package com.mushuilingfeng.ddd.user.base;

import cn.hutool.extra.spring.SpringUtil;
import com.mushuilingfeng.ddd.user.domain.user.entity.User;
import com.mushuilingfeng.spring.security.TokenUtil;
import com.mushuilingfeng.ddd.user.service.ITokenService;

/**
 * @author 沐水淋风
 * @date 2024/10/16
 */
public class UserContext {
    
    public static User getCurrentUser() {
        return SpringUtil.getBean(ITokenService.class).getUserByToken(TokenUtil.getToken());
    }
    
}
